<template>
	<div>
		  <el-checkbox v-model="selectData[0].type" @change='toggle(0)'>备选项</el-checkbox>
		  <el-checkbox v-model="selectData[1].type" @change='toggle(1)'>备选项</el-checkbox>
		  <el-checkbox v-model="selectData[2].type" @change='toggle(2)'>备选项</el-checkbox>
		  <el-checkbox v-model="selectData[3].type" @change='toggle(3)'>备选项</el-checkbox>
		  <el-checkbox v-model="selectData[4].type" @change='toggle(4)'>备选项</el-checkbox>
	</div>
</template>
<script>
export default {
  data() {
    return {
      selectData: [
        {
          index: 0,
          type: false
        },
        {
          index: 2,
          type: true
        },
        {
          index: 3,
          type: false
        },
        {
          index: 4,
          type: false
        },
        {
          index: 5,
          type: false
        }
      ]
    };
  },
  methods: {
    toggle(value) {
      console.log(value);
      this.selectData.forEach((item, index) => {
        if (index === value) {
          item.type = true;
        } else {
          item.type = false;
        }
      });
    }
  }
};
</script>
